//
//  CollectionViewCell.m
//  timemovie
//
//  Created by Yiqiao on 15/7/21.
//  Copyright (c) 2015年 Yiqiao. All rights reserved.
//

#import "CollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation CollectionViewCell


- (void)awakeFromNib {

    // Initialization code
}

- (void)setModel:(MObj *)model{
    _model = model;
    _star.average = _model.average;
    [self setNeedsLayout];
}


- (void)layoutSubviews{
    [super layoutSubviews];
    _movieTitle.text = _model.title;
    _movieTitle.textColor = [UIColor redColor];
    _movieTitle.textAlignment = NSTextAlignmentCenter;
    _averageScore.text = [NSString stringWithFormat:@"%0.1f",_model.average];
    [_movieImage sd_setImageWithURL:[NSURL URLWithString:[_model.images objectForKey:@"medium"]]];
   // _movieImage.backgroundColor = [UIColor redColor];
}

@end
